{layout name="passport:login:layout" /}
<div class="login_wrap">
    <div class="title"><a href="//{$web.url}"><img src="__PUBLIC__/manage/managerlogo.png" /></a></div>
    <form id="form" action="{:url('system/passport.Login/reg')}">
        <input type="hidden" name="__token__" value="{$Request.token}" />
        <div class="row fn-clear"><input autocomplete="off"  datatype="*" class="input" type="txt" name="username" placeholder="昵称" /></div>
        <div class="row fn-clear">
            <input autocomplete="off" datatype="m" class="input w200 fn-left" type="text" id="regphone_id" name="phone_id" placeholder="手机号" x-webkit-speech />
            <button id="reg_code" type="button" class="button fn-right fn-cp">获取验证码</button>
        </div>
        <div class="row fn-clear"><input autocomplete="off" datatype="*" class="input" type="txt" name="sms_code" placeholder="验证码" /></div>
        <div class="row fn-clear"><input autocomplete="off" datatype="*" class="input" type="password" name="login_password" placeholder="密码" autocomplete="off" /></div>
        <div class="row fn-clear captcha">
            <div class="fn-left"><input autocomplete="off" datatype="*" class="input" type="text" name="captcha" placeholder="验证码" /></div>
            <div class="fn-left"><img id="captcha"  src="{:captcha_src()}" alt="captcha" onclick="reimg()"/></div>
        </div>
        <div class="row"><button class="btn" type="submit">注册</button></div>
    </form>
    <div class="bottom">
        <a href="{:url('system/passport.Login/index')}" class="button button-violet"><i class="iconfont icon-xiugaidenglumima"></i> 返回登录</a>
        <a href="{:url('system/passport.Login/getpassword')}" class="button"><i class="iconfont icon-security"></i> 找回密码</a>
    </div>
</div>
<script type="text/javascript">
Do.add('common',{path:'__PUBLIC__/manage/common.js'});
Do('layer','form','common',function(){
    $("#form").Validform({
        btnSubmit:".btn",ajaxPost:true,tiptype:function(){},postonce:true,callback:function(data){
        if(data.code == 200){
            layer.alert(data.message,{icon:1},function(index){
                layer.close(index);
                window.location.href = data.url;
            });
        }else{
            layer.alert(data.message,{icon:5}
        );
        }}
    });
    /*获取验证码*/
    var sms_api = "{:url('system/passport.login/getRegSms')}";
    $("#reg_code").click([sms_api],function(){
        wechat_getsms($('#regphone_id').val(),sms_api,this);
    })
})
//刷新验证码
function reimg(){
var img = document.getElementById("captcha");
img.src = "{:captcha_src()}?rnd=" + Math.random();
}
</script>